package cn.signalpha.modules.shop.entity;

import cn.signalpha.core.swagger.ApiModelPropertyEnum;
import cn.signalpha.modules.shop.entity.enums.GoodsStatusEnum;
import cn.signalpha.modules.shop.entity.enums.GoodsTypeEnum;
import cn.signalpha.modules.shop.vo.GoodsSpecKeyVO;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 商品实体类
 *
 * @author suguangjun
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("shop_goods")
@ApiModel(value = "Goods对象", description = "商品")
public class Goods implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "商户id")
    private Long sellerId;

	@ApiModelProperty(value = "种类：1商品库 2商城商品")
	private Integer kind;

	@ApiModelProperty(value = "商品类型")
	@ApiModelPropertyEnum(GoodsTypeEnum.class)
	private Integer type;

	@ApiModelProperty(value = "商品状态")
	@ApiModelPropertyEnum(GoodsStatusEnum.class)
	private Integer status;

    @ApiModelProperty(value = "平台商品分类id")
    private String categoryId;

	@ApiModelProperty(value = "商户商品分类id")
	private String sellerGoodsCategoryId;

	@ApiModelProperty(value = "品牌id")
	private Long brandId;

	@ApiModelProperty(value = "保障服务id")
	private String serveId;

	@ApiModelProperty(value = "标签id")
	private String tagId;

    @ApiModelProperty(value = "商品名称")
    private String name;

	@ApiModelProperty(value = "商品编码")
	private String sn;

    @ApiModelProperty(value = "商品简介")
    private String brief;

	@ApiModelProperty(value = "商品详情")
	private String detail;

    @ApiModelProperty(value = "商品封面")
    private String img;

    @ApiModelProperty(value = "商品图片")
    private String imgList;

    @ApiModelProperty(value = "商品库存")
    private Integer stock;

    @ApiModelProperty(value = "商品价")
    private Double goodsPrice;

    @ApiModelProperty(value = "市场价")
    private Double marketPrice;

    @ApiModelProperty(value = "销量")
    private Integer salesVolume;

    @ApiModelProperty(value = "虚拟销量")
    private Integer salesVolumeVirtual;

	@ApiModelProperty(value = "运费模板id")
	private Long transportId;

    @ApiModelProperty(value = "是否热门")
    private Integer isHot;

    @ApiModelProperty(value = "是否推荐")
    private Integer isPush;

	@ApiModelProperty(value = "排序值")
	private Integer sort;

	@ApiModelProperty(value = "点击量")
	private Integer clickNum;

	@ApiModelProperty(value = "评价数")
	private Integer commentNum;

	@ApiModelProperty(value = "审核备注")
	private String remark;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

	@Version
	@ApiModelProperty(value = "版本号")
	private Integer version;

	@TableField(exist = false)
	@ApiModelProperty(value = "商品属性列表")
	private List<GoodsAttr> goodsAttrList;

	@TableField(exist = false)
	@ApiModelProperty(value = "商品规格列表")
	private List<GoodsSpecKeyVO> goodsSpecKeyList;

	@TableField(exist = false)
	@ApiModelProperty(value = "商品SKU")
	private List<GoodsSku> goodsSkuList;

	@ApiModelProperty(value = "导入商品id")
	private Long importId;

}
